import { createRouter, createWebHistory } from 'vue-router';

// 创建路由规则
export const routes = [
    {
        path: '/',
        component: ()=>import('../views/index.vue'),
        children:[{
            path: 'page1',
            component: ()=>import('../views/page/page1.vue'),
        },{
            path: 'page2',
            component: ()=>import('../views/page/page2.vue'),
        },{
            path: 'page3',
            component: ()=>import('../views/page/page3.vue'),
        }]
    }
];

// 创建router实例
const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
